﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Setting_do_SaveEmplRole : SessionPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
		string roleID = Request.Form["roleID"] + "";
		string emplID = Request.Form["emplID"] + "";

		if (string.IsNullOrEmpty(roleID) || string.IsNullOrEmpty(emplID))
			Response.End();

		LogicLayer mgr = new LogicLayer();

		string[] eidArray = emplID.Split(',');
		foreach (string eid in eidArray)
		{
			if (string.IsNullOrEmpty(eid))
				continue;

			SYS_EmplRole er = new SYS_EmplRole();
			er.EmplID = eid;
			er.RoleID = roleID;
			mgr.AddSYS_EmplRole(er);
		}

		Response.Write("ok");
    }
}